#!/usr/bin/python2
# -*- coding: UTF-8 -*-

import sys
import os
import csv

class CvsParser:
    def __init__(self):
        pass

    def __del__(self):
        self.csvfile.close()
        pass

    def open(self, path, title):
        self.path = path
        self.csvfile = file(path, 'wb')
        self.writer = csv.writer(self.csvfile)
        # self.writer.writerow(['漏洞类型', '应用名', '版本', 'CVE', '发布时间', '安全级别', '漏洞名称', '漏洞描述', '英文描述'])
        self.writer.writerow(title)
        pass

    def writeRows(self, rows):
        # self.writer.writerows(('111', '2222', '333', '444', '555'))
        self.writer.writerows(rows)
        pass

    # def close(self):
    #     self.csvfile.close()
    #     pass